package com.tuyou.cloud.feign.controller;

import com.tuyou.cloud.feign.service.HelloService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class ConsumerController {

    @Autowired
    HelloService helloService;

//    @Autowired
//    DefaultFeignService helloService;

//    @Resource(type = CommonService.class)
//    CommonService helloService;

    @RequestMapping(value = "/feign-consumer", method = RequestMethod.GET)
    public String helloConsumer() throws InterruptedException {
        logger.info("feign-consumer call helloService.hello");
        return helloService.hello();
    }
}
